<template>
  <nav class="app-topnav">
    <ul class="container">
      <li><a href="javascript:;"><i class="iconfont icon-user"></i>{{profile.account}}</a></li>
      <li><a href="javascript:;">退出登录</a></li>
      <li><a href="javascript:;">请先登录</a></li>
      <li><a href="javascript:;">免费注册</a></li>
      <li><a href="javascript:;">我的订单</a></li>
      <li><a href="javascript:;">会员中心</a></li>
      <li><a href="javascript:;">帮助中心</a></li>
      <li><a href="javascript:;">关于我们</a></li>
      <li><a class="endb" href="javascript:;"><i class="iconfont icon-phone"></i> 手机版</a></li>
    </ul>
  </nav>
</template>
<script>
import { useStore } from 'vuex'
import { computed } from 'vue'
export default {
  name: 'app-topnav',
  setup () {
    const store = useStore()
    const profile = computed(() => {
    // 拿到User模块用户人的信息
      return store.state.user.profile
    })
    return { profile }
  }
}
</script>
<style lang="less" scoped>
.app-topnav {
  height: 50px;
  background-color: #333333;
  .container {
    height: 50px;
    line-height: 50px;
    color: #cdcdcd;
    display: flex;
    justify-content: flex-end;
    li{
        a{
            line-height: 1;
            font-size: 14px;
            color: #fff;
            padding: 0 10px;
            border-right: 1px solid #fff;
            &:hover{
                color: @xtxColor;
            }
        }
        .endb{
            border-right: none;
        }
    }
  }
}
</style>
